package com.yhsimon.composite;

/**
 * @author： YHSimon
 * @date： 2021-09-02 16:01
 */
public abstract class OrganizationComponent {

    private String name;
    private String des;
    protected void add(OrganizationComponent organizationComponent){
        //默认实现
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationComponent organizationComponent){
        //默认实现
        throw new UnsupportedOperationException();
    }

    //构造器
    public OrganizationComponent(String name,String des){
        super();
        this.name=name;
        this.des=des;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    //抽象方法 print(),子类均需实现
    public abstract void print();
}
